package com.cxcs.cxcsojbackendserviceclient.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cxcs.cxcsojbackendmodel.dto.question.QuestionQueryRequest;
import com.cxcs.cxcsojbackendmodel.entity.Question;
import com.cxcs.cxcsojbackendmodel.entity.QuestionSubmit;
import com.cxcs.cxcsojbackendmodel.vo.QuestionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 *  【远程接口】 客户端 题目服务
 *
 * @author CxCS
 * @Version: 1.0
 */
@FeignClient(name = "cxcsoj-backend-question-service", path = "/api/question/inner")
public interface QuestionFeignClient {

    /** 【远程接口】
     *  根据 id 获取题目
     *
     * @param questionId
     * @return
     */
    @GetMapping("/get/id")
    Question getQuestionById(@RequestParam("questionId") long questionId);

    /** 【远程接口】
     *  根据 id 更新题目（通过数、提交数）
     *
     * @param question
     * @return
     */
    @PostMapping("/update")
    Boolean updateQuestionById(@RequestBody Question question);

    /** 【远程接口】
     *  根据id 获取题目提交信息
     *
     * @param questionSubmitId
     * @return
     */
    @GetMapping("/question_submit/get/id")
    QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId") long questionSubmitId);

    /** 【远程接口】
     *  根据id 更新 题目提交信息
     *
     * @param questionSubmit
     * @return
     */
    @PostMapping("/question_submit/update")
    Boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmit);
}
